package cn.getech.data.development.constant;

import lombok.Getter;

/**
 * 任务类型的枚举
 *
 * @author zenith
 */
@Getter
public enum ErrorType {


    CONNECT(1, "数据源连接"),
    TABLE(2, "数据仓库"),
    UDF(3, "udf函数"),
    WORKFLOW(4, "作业流"),
    WORKFLOWLAY(5, "作业流依赖");

    int code;
    String name;

    ErrorType(int code, String message) {
        this.code = code;
        this.name = message;
    }

    public static ErrorType ObjOf(Integer code) {
        if (code == null) {
            return null;
        } else {
            for (ErrorType s : ErrorType.values()) {
                if (s.getCode() == code) {
                    return s;
                }
            }
            return null;
        }
    }
}
